I have been working/playing with AJAX quite long time, during which I have evolved the lots of things about AJAX, its advantages and disadvantages.
Few months ago My Team was working on http://www.jyve.com and we are using AJAX in heavy range for http://www.jyve.com which is suppose to be first Ask An Expert engine in the web world.
Remember your one AJAX request opens one TCP connection to your server, you can see those connection with following commands
# netstat -tap
You can see the requests in various states like TIME_WAIT, LISTEN
If you find lots of http request in CLOSE_WAIT or FIN_WAIT status it means there is a problem.
Now I wont tell you how write a script for AJAX that you can find anywhere on google :).
I just want to warn you before using AJAX that if you are transferring huge amount of data via AJAX request then your server gonna create problem for you. Following is remedy which you can use for best performance of AJAX requests.
open /etc/sysctl.conf file (this is Kernel Settings file)
And add following code at the end of the file
# ADDED BY VIKRANT - 7/12/2006-----------
# For avoid to have a big TCP queue and so memory usage for not really
# active connection I decrease some TCP timeout and force the kernel to
# recycle quickly tcp connection. We don.t cache the value of ssthresh
# (Slow Start Threshold) for avoid to impact a given host to have a reduced
# ssthresh for all is next connections.
net.ipv4.tcp_keepalive_time=300
net.ipv4.tcp_fin_timeout=30
net.ipv4.tcp_max_orphans=16384
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_tw_recycle=1
net.ipv4.tcp_rfc1337=1
net.ipv4.tcp_no_metrics_save=1
# It.s critical to use the optimal SEND and RECEIVE socket buffer size for the link
# you are using. In our case we have a 100Mbits link connection. So for a better TCP
# connection and congestion control we had to increase the TCP Buffer
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_wmem=4096 65536 16777216
After that Fire following command
# sysctl -p /etc/sysctl.confFor more reference you read really one really great post Fine tuning a Linux Apache MySQL PHP (LAMP) server
----------
Enjoy the AJAX power!!!!